package com.test;

import com.lx.core.annotation.Param;
import com.lx.core.annotation.RequestBody;
import com.lx.db.LXRedis;
import com.lx.core.annotation.Bean;
import com.lx.core.annotation.Request;
import com.lx.util.LX;

import java.util.Map;

@Bean
@Request("/a")
public class A {

    @Bean
    private LXRedis redis;

    @Request(value = "get",requestType = Request.RequestType.GET)
    public Map test(@Param("a") String a, @Param("b") Integer b){
        return redis.get("xx");
    }
    @Request(value = "put",requestType = Request.RequestType.POST)
    public void put(@RequestBody Map<String,String> map){
        redis.put("xx",map);
    }

    public static void main(String[]args) {
//        String s = LX.doPost("http://127.0.0.1:1234/a/put", "{'a'=1}");
//        System.out.println(s);
        String s1 = LX.doGet("http://127.0.0.1:1234/a/get?a=123&b=321.1");
        System.out.println(s1);
    }

}
